﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace JuSolution.Web.ApiService
{
    /// <summary>
    /// WCUploadService 的摘要说明
    /// </summary>
    public class WCUploadService : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            Stream s = context.Request.InputStream;
            
            FileStream fs = 
                new FileStream(context.Server.MapPath("/ClientBin") + "/" + "asdf.jpg", FileMode.Create);
            byte[] bytes = new byte[s.Length];
            s.Read(bytes, 0, bytes.Length);
            fs.Write(bytes, 0, bytes.Length);
            fs.Flush();
            fs.Close();
        }
        
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}